﻿namespace GenericListProgram
{
    using System;
    using System.Collections.Generic;

    class Program
    {
        static void Main()
        {
            GenericList<int> genericList = new GenericList<int>(4);
            Console.WriteLine(genericList);

            genericList.Add(1);
            genericList.Add(3);
            genericList.Add(4);
            genericList.Add(4);
            genericList.Add(5);
            genericList.Add(5);
            List<int> i = new List<int>();
            i.Remove(1);
            Console.WriteLine(genericList);
            Console.WriteLine("Capacity: {0}", genericList.Capacity);
            Console.WriteLine("Count: {0}", genericList.Count);

            int index = 1;
            Console.WriteLine("Element at index {0}: {1}", index, genericList[index]);

            genericList.RemoveAt(1);
            Console.WriteLine(genericList.FindIndex(s => s.Equals(1)));
            Console.WriteLine(genericList);

            Console.WriteLine("Min element in GenericList: {0}", genericList.Min());
            Console.WriteLine("Max element in GenericList: {0}", genericList.Max());

            genericList.Clear();
            Console.WriteLine(genericList);
        }
    }
}
